package com.ktjy.service.impl;

import com.ktjy.dao.NewsDao;
import com.ktjy.dao.impl.NewsDaoImpl;
import com.ktjy.factory.SimpleDaoFactory;
import com.ktjy.pojo.News;
import com.ktjy.service.NewsService;

public class NewsServiceImpl implements NewsService {
//    private NewsDao dao= SimpleDaoFactory.getInstance();
    private NewsDao dao;
    public void setDao(NewsDao dao) {
        this.dao = dao;
    }

    NewsDao newsDao=new NewsDaoImpl();



    @Override
    public void save(News news) {
        newsDao.save(news);
    }

    public void addNews(News news){
        dao.save(news);
    }
}
